package com.sparrow.example_message.map.vo;

import java.io.Serializable;

import com.baidu.bjf.remoting.protobuf.*;

import java.util.*;

import com.baidu.bjf.remoting.protobuf.FieldType;

import com.baidu.bjf.remoting.protobuf.utils.*;

import com.google.protobuf.*;

import java.io.IOException;

import java.lang.reflect.*;

import com.baidu.bjf.remoting.protobuf.code.*;

import com.sparrow.example_message.map.vo.MonsterVO;


public class MonsterVO$$JProtoBufClass implements com.baidu.bjf.remoting.protobuf.Codec<com.sparrow.example_message.map.vo.MonsterVO>, Serializable {
	public static final long serialVersionUID = 1L;
    private com.google.protobuf.Descriptors.Descriptor descriptor;

    public byte[] encode(com.sparrow.example_message.map.vo.MonsterVO t) throws IOException {
        CodecOutputByteArray output = CodecOutputByteArray.get();
        doWriteTo(t, output.getCodedOutputStream());
        return output.getData();
    }

    public com.sparrow.example_message.map.vo.MonsterVO decode(byte[] bb) throws IOException {
        CodedInputStream input = CodedInputStream.newInstance(bb, 0, bb.length);
        return readFrom(input);
    }

    public int size(com.sparrow.example_message.map.vo.MonsterVO t) throws IOException {
        int size = 0;
        
        Long f_1 = null;
        if (!CodedConstant.isNull(t.getMonsterId())) {
            f_1 = t.getMonsterId();  
            size += com.google.protobuf.CodedOutputStream.computeInt64Size(1,f_1.longValue());

        }
        
        
        Object f_2 = null;
        if (!CodedConstant.isNull(t.getPos())) {
            f_2 = t.getPos();  
            size += CodedConstant.computeSize(2,f_2, com.baidu.bjf.remoting.protobuf.FieldType.OBJECT,false,null);

        }
        
        
        Float f_3 = null;
        if (!CodedConstant.isNull(t.getSpeed())) {
            f_3 = t.getSpeed();  
            size += com.google.protobuf.CodedOutputStream.computeFloatSize(3,f_3.floatValue());

        }
        
        
        Integer f_4 = null;
        if (!CodedConstant.isNull(t.getAngle())) {
            f_4 = t.getAngle();  
            size += com.google.protobuf.CodedOutputStream.computeInt32Size(4,f_4.intValue());

        }
        
        
        Collection f_5 = null;
        if (!CodedConstant.isNull(t.getRoads())) {
            f_5 = t.getRoads();  
            size += CodedConstant.computeListSize(5, f_5, com.baidu.bjf.remoting.protobuf.FieldType.OBJECT, false, null,false);

        }
        
        
        Integer f_6 = null;
        if (!CodedConstant.isNull(t.getRoadIndex())) {
            f_6 = t.getRoadIndex();  
            size += com.google.protobuf.CodedOutputStream.computeInt32Size(6,f_6.intValue());

        }
        
        
        Integer f_7 = null;
        if (!CodedConstant.isNull(t.getConfigId())) {
            f_7 = t.getConfigId();  
            size += com.google.protobuf.CodedOutputStream.computeInt32Size(7,f_7.intValue());

        }
        
        
        Integer f_8 = null;
        if (!CodedConstant.isNull(t.getAtk())) {
            f_8 = t.getAtk();  
            size += com.google.protobuf.CodedOutputStream.computeInt32Size(8,f_8.intValue());

        }
        
        
        Integer f_9 = null;
        if (!CodedConstant.isNull(t.getHp())) {
            f_9 = t.getHp();  
            size += com.google.protobuf.CodedOutputStream.computeInt32Size(9,f_9.intValue());

        }
        
        
        Integer f_10 = null;
        if (!CodedConstant.isNull(t.getMaxHp())) {
            f_10 = t.getMaxHp();  
            size += com.google.protobuf.CodedOutputStream.computeInt32Size(10,f_10.intValue());

        }
        
        
        return size;
    }
 
    public void doWriteTo(com.sparrow.example_message.map.vo.MonsterVO t, CodedOutputStream output)
            throws IOException {
         
        Long f_1 = null;
        if (!CodedConstant.isNull(t.getMonsterId())) {
            f_1 = t.getMonsterId();
            if (f_1 != null){
output.writeInt64(1, f_1.longValue());
}
  
        }
        
        Object f_2 = null;
        if (!CodedConstant.isNull(t.getPos())) {
            f_2 = t.getPos();
            if (f_2 != null){
CodedConstant.writeObject(output,2,com.baidu.bjf.remoting.protobuf.FieldType.OBJECT,f_2, false);
}
  
        }
        
        Float f_3 = null;
        if (!CodedConstant.isNull(t.getSpeed())) {
            f_3 = t.getSpeed();
            if (f_3 != null){
output.writeFloat(3, f_3.floatValue());
}
  
        }
        
        Integer f_4 = null;
        if (!CodedConstant.isNull(t.getAngle())) {
            f_4 = t.getAngle();
            if (f_4 != null){
output.writeInt32(4, f_4.intValue());
}
  
        }
        
        Collection f_5 = null;
        if (!CodedConstant.isNull(t.getRoads())) {
            f_5 = t.getRoads();
            if (f_5 != null){
CodedConstant.writeToList(output,5,com.baidu.bjf.remoting.protobuf.FieldType.OBJECT,f_5,false);
}
  
        }
        
        Integer f_6 = null;
        if (!CodedConstant.isNull(t.getRoadIndex())) {
            f_6 = t.getRoadIndex();
            if (f_6 != null){
output.writeInt32(6, f_6.intValue());
}
  
        }
        
        Integer f_7 = null;
        if (!CodedConstant.isNull(t.getConfigId())) {
            f_7 = t.getConfigId();
            if (f_7 != null){
output.writeInt32(7, f_7.intValue());
}
  
        }
        
        Integer f_8 = null;
        if (!CodedConstant.isNull(t.getAtk())) {
            f_8 = t.getAtk();
            if (f_8 != null){
output.writeInt32(8, f_8.intValue());
}
  
        }
        
        Integer f_9 = null;
        if (!CodedConstant.isNull(t.getHp())) {
            f_9 = t.getHp();
            if (f_9 != null){
output.writeInt32(9, f_9.intValue());
}
  
        }
        
        Integer f_10 = null;
        if (!CodedConstant.isNull(t.getMaxHp())) {
            f_10 = t.getMaxHp();
            if (f_10 != null){
output.writeInt32(10, f_10.intValue());
}
  
        }
        
    }            
 
    public void writeTo(com.sparrow.example_message.map.vo.MonsterVO t, CodedOutputStream output)
            throws IOException {
        doWriteTo(t, output);
    }
 
    public com.sparrow.example_message.map.vo.MonsterVO readFrom(CodedInputStream input) throws IOException {
        com.sparrow.example_message.map.vo.MonsterVO ret = new com.sparrow.example_message.map.vo.MonsterVO();
        
        ret.setRoads(new ArrayList())
;


        
        try {
            boolean done = false;
            Codec codec = null;
            while (!done) {
                int tag = input.readTag();
                if (tag == 0) {
                    break;
                }
                
                if (tag == 8) {
                    
                    ret.setMonsterId(input.readInt64())
;

                    
                    
                    continue;
                }
                
                
                if (tag == 18) {
                    codec = ProtobufProxy.create(com.sparrow.example_message.map.vo.PositionVo.class, false,ProtobufProxy.OUTPUT_PATH.get());
int length = input.readRawVarint32();
final int oldLimit = input.pushLimit(length);

                    ret.setPos((com.sparrow.example_message.map.vo.PositionVo) codec.readFrom(input))
;

                    input.checkLastTagWas(0);
input.popLimit(oldLimit);

                    
                    continue;
                }
                
                
                if (tag == 29) {
                    
                    ret.setSpeed(input.readFloat())
;

                    
                    
                    continue;
                }
                
                
                if (tag == 32) {
                    
                    ret.setAngle(input.readInt32())
;

                    
                    
                    continue;
                }
                
                
                if (tag == 42) {
                    codec = ProtobufProxy.create(com.sparrow.example_message.map.vo.PositionVo.class, false,ProtobufProxy.OUTPUT_PATH.get());
int length = input.readRawVarint32();
final int oldLimit = input.pushLimit(length);

                    if ((ret.getRoads()) == null) {
List __list = new ArrayList();
ret.setRoads(__list);
}
(ret.getRoads()).add((com.sparrow.example_message.map.vo.PositionVo) codec.readFrom(input));

                    input.checkLastTagWas(0);
input.popLimit(oldLimit);

                    
                    continue;
                }
                
                
                if (tag == 48) {
                    
                    ret.setRoadIndex(input.readInt32())
;

                    
                    
                    continue;
                }
                
                
                if (tag == 56) {
                    
                    ret.setConfigId(input.readInt32())
;

                    
                    
                    continue;
                }
                
                
                if (tag == 64) {
                    
                    ret.setAtk(input.readInt32())
;

                    
                    
                    continue;
                }
                
                
                if (tag == 72) {
                    
                    ret.setHp(input.readInt32())
;

                    
                    
                    continue;
                }
                
                
                if (tag == 80) {
                    
                    ret.setMaxHp(input.readInt32())
;

                    
                    
                    continue;
                }
                
                               
                
                input.skipField(tag);
            }
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e;
        } catch (java.io.IOException e) {
            throw e;
        }

        return ret;       
        
    } 
 
 
     public com.google.protobuf.Descriptors.Descriptor getDescriptor() throws IOException {
        if (this.descriptor != null) {
            return this.descriptor;
        }
        com.google.protobuf.Descriptors.Descriptor descriptor =
                CodedConstant.getDescriptor(com.sparrow.example_message.map.vo.MonsterVO.class);
        return (this.descriptor = descriptor);
    }   
}

    